/**
 *	(C) 2014 Yuanjj
 *
 * 	define protocal
 *
 *	histroy
 * 		2014-08-08	Yuanjj		-	create
 */

#ifndef _PROTOCAL_H_
#define _PROTOCAL_H_

#include "typedef.h"

#define		HEAD_MAGIC		0x20140807

#define		MAIN_DB			0x80
#define		MAIN_NET		0x81
#define		MAIN_UI			0x82

#define		FILL_HEAD( _head_, _main_, _sec_, _entry_, _size_ )		\
                (_head_).magic		= HEAD_MAGIC;					\
                (_head_).main		= (_main_);						\
                (_head_).second		= (_sec_);						\
                (_head_).entry		= (_entry_);					\
                (_head_).size		= (_size_)

typedef struct _head_in
{
    pem_s32_t		magic;			// 0x20140807
    pem_u8_t		main;			// main protocal number
    pem_u8_t		second;			// sub protocal number
    pem_u32_t		entry;			// event entery
    pem_u32_t		size;			// data size
} head_in;

/**
 *	behavior entry
 */
enum	_ENTRY
{
    EN_NONE,
    EN_SCENE_SAVE,
};

enum 	_DEV_STATUS
{
    DEV_ST_NONE,
    DEV_ST_SETTING,
    DEV_ST_DONE
};



/***************************************************
 * field len definiation
 ***************************************************/
#define		DATETIME_LEN		32
#define		REMARK_LEN			256

#define		USER_ACCOUNT_LEN	64
#define		USER_PASSWORD_LEN	128

#define		HOST_ID_LEN			64
#define		HOST_NAME_LEN		64
#define		HOST_IP_LEN			256

#define		DEV_ID_LEN			32
#define		DEV_TYPE_LEN		32
#define		DEV_NAME_LEN		64
#define		DEV_PROBE_LEN		64
#define		DEV_APPEND_LEN		16
#define		DEV_IMG_LEN			256
#define		DEV_POS_LEN			256
#define		DEV_MACHINE_LEN		64
#define		DEV_VALUE_LEN		32

#define		TUNNEL_NAME_LEN		64
#define		TUNNEL_TYPE_LEN		64
#define		TUNNEL_NUMBER_LEN	64

#define		PTO_NAME_LEN		64
#define		PTO_FILE_LEN		256

#define		SCENE_IMG_LEN		256

#define		ALARM_CMP_LEN		8

#define		EVENT_TYPE_LEN		32
#define		EVENT_DESCRIPT_LEN	256

#endif // _PROTOCAL_H_
